﻿using System;

namespace DotNetRepository.Tools
{
    internal class WeakReference<T> where T : class
    {
        private readonly WeakReference _reference;

        internal WeakReference(T obj)
        {
            _reference = new WeakReference(obj);
        }

        internal bool IsAlive
        {
            get { return _reference.IsAlive;}
        }

        internal T Target
        {
            get { return _reference.Target as T;}
        }
    }
}
